package com.bsj.power.common.netty;

import com.bsj.power.common.constant.NumericalConstants;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Description 仓位信息
 * @Author zhaoyang
 * @Date 2024/9/23 10:34
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class StockInfo {
    /**
     * 仓位编号 1~60
     */
    private Integer serialNum;
    /**
     * 表示仓位状态，0 表示空仓，1 表示非空仓，2 表示禁用
     */
    private Integer state;
    /**
     * 表示该仓位工牌编号，空仓无该值
     */
    private String uwbNo;
    /**
     * 表示该仓位工牌当前电量，空仓无该值
     */
    private String uwbPower;
    /**
     * 表示该仓位工牌的版本（取原始版本信息的后 10 个字符），空仓无该值
     */
    private String uwbVersion;


    public StockInfo(CRReceiveData crReceiveData) {
        this.serialNum = crReceiveData.getSerialNum();
        this.state = crReceiveData.getResult();
        this.uwbNo = crReceiveData.getUwbId();
        this.uwbPower = crReceiveData.getUwbPower();
    }

    public StockInfo(Integer serialNum) {
        this.serialNum = serialNum;
        this.state = NumericalConstants.ZERO;
    }
}
